home *** CD-ROM | disk | FTP | other *** search
/ 1st Multimedia Mac Shareware / Multimedia Shareware CD-ROM - BetaCorp.iso / StackToolsƒ / Utilities / AutoHelpDemo / cards.xml < prev    next >
Encoding:
Text File  |  1992-08-18  |  9.4 KB  |  162 lines

  1. card_3033.xml
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  4. <card>
  5.     <id>3033</id>
  6.     <filler1>0</filler1>
  7.     <bitmap>BMAP_3165.pbm</bitmap>
  8.     <cantDelete> <true /> </cantDelete>
  9.     <showPict> <true /> </showPict>
  10.     <dontSearch> <false /> </dontSearch>
  11.     <owner>2722</owner>
  12.     <link rel="stylesheet" type="text/css" href="stylesheet_3335.css" />
  13.     <part>
  14.         <id>14</id>
  15.         <type>field</type>
  16.         <visible> <false /> </visible>
  17.         <dontWrap> <false /> </dontWrap>
  18.         <dontSearch> <false /> </dontSearch>
  19.         <sharedText> <false /> </sharedText>
  20.         <fixedLineHeight> <true /> </fixedLineHeight>
  21.         <autoTab> <false /> </autoTab>
  22.         <lockText> <true /> </lockText>
  23.         <rect>
  24.             <left>283</left>
  25.             <top>86</top>
  26.             <right>493</right>
  27.             <bottom>262</bottom>
  28.         </rect>
  29.         <style>scrolling</style>
  30.         <autoSelect> <false /> </autoSelect>
  31.         <showLines> <false /> </showLines>
  32.         <wideMargins> <true /> </wideMargins>
  33.         <multipleLines> <false /> </multipleLines>
  34.         <reservedFamily> 0 </reservedFamily>
  35.         <titleWidth>0</titleWidth>
  36.         <icon>0</icon>
  37.         <textAlign>left</textAlign>
  38.         <font>Geneva</font>
  39.         <textSize>12</textSize>
  40.         <textStyle>plain</textStyle>
  41.         <textHeight>16</textHeight>
  42.         <name>About AutoHelp Demo</name>
  43.         <script>on mouseUp
  44. if the optionKey is down then
  45. pass mouseUp
  46. end if
  47.  
  48. hide card field "About Autohelp Demo"
  49. end mouseUp
  50. </script>
  51.     </part>
  52.     <part>
  53.         <id>15</id>
  54.         <type>field</type>
  55.         <visible> <true /> </visible>
  56.         <dontWrap> <false /> </dontWrap>
  57.         <dontSearch> <false /> </dontSearch>
  58.         <sharedText> <false /> </sharedText>
  59.         <fixedLineHeight> <true /> </fixedLineHeight>
  60.         <autoTab> <false /> </autoTab>
  61.         <lockText> <true /> </lockText>
  62.         <rect>
  63.             <left>269</left>
  64.             <top>28</top>
  65.             <right>480</right>
  66.             <bottom>62</bottom>
  67.         </rect>
  68.         <style>transparent</style>
  69.         <autoSelect> <false /> </autoSelect>
  70.         <showLines> <false /> </showLines>
  71.         <wideMargins> <false /> </wideMargins>
  72.         <multipleLines> <false /> </multipleLines>
  73.         <reservedFamily> 0 </reservedFamily>
  74.         <titleWidth>0</titleWidth>
  75.         <icon>0</icon>
  76.         <textAlign>center</textAlign>
  77.         <font>Geneva</font>
  78.         <textSize>12</textSize>
  79.         <textStyle>outline</textStyle>
  80.         <textStyle>bold</textStyle>
  81.         <textHeight>16</textHeight>
  82.         <name></name>
  83.         <script></script>
  84.     </part>
  85.     <part>
  86.         <id>16</id>
  87.         <type>field</type>
  88.         <visible> <true /> </visible>
  89.         <dontWrap> <false /> </dontWrap>
  90.         <dontSearch> <false /> </dontSearch>
  91.         <sharedText> <false /> </sharedText>
  92.         <fixedLineHeight> <true /> </fixedLineHeight>
  93.         <autoTab> <false /> </autoTab>
  94.         <lockText> <true /> </lockText>
  95.         <rect>
  96.             <left>254</left>
  97.             <top>286</top>
  98.             <right>490</right>
  99.             <bottom>322</bottom>
  100.         </rect>
  101.         <style>transparent</style>
  102.         <autoSelect> <false /> </autoSelect>
  103.         <showLines> <false /> </showLines>
  104.         <wideMargins> <false /> </wideMargins>
  105.         <multipleLines> <false /> </multipleLines>
  106.         <reservedFamily> 0 </reservedFamily>
  107.         <titleWidth>0</titleWidth>
  108.         <icon>0</icon>
  109.         <textAlign>center</textAlign>
  110.         <font>Geneva</font>
  111.         <textSize>12</textSize>
  112.         <textStyle>outline</textStyle>
  113.         <textStyle>bold</textStyle>
  114.         <textHeight>16</textHeight>
  115.         <name></name>
  116.         <script></script>
  117.     </part>
  118.     <part>
  119.         <id>17</id>
  120.         <type>button</type>
  121.         <visible> <true /> </visible>
  122.         <reserved5> 0 </reserved5>
  123.         <reserved4> 0 </reserved4>
  124.         <reserved3> 0 </reserved3>
  125.         <reserved2> 0 </reserved2>
  126.         <reserved1> 0 </reserved1>
  127.         <enabled> <true /> </enabled>
  128.         <rect>
  129.             <left>25</left>
  130.             <top>47</top>
  131.             <right>61</right>
  132.             <bottom>75</bottom>
  133.         </rect>
  134.         <style>roundrect</style>
  135.         <showName> <false /> </showName>
  136.         <highlight> <false /> </highlight>
  137.         <autoHighlight> <false /> </autoHighlight>
  138.         <sharedHighlight> <true /> </sharedHighlight>
  139.         <family>0</family>
  140.         <titleWidth>0</titleWidth>
  141.         <icon>21847</icon>
  142.         <textAlign>center</textAlign>
  143.         <font>Chicago</font>
  144.         <textSize>12</textSize>
  145.         <textStyle>plain</textStyle>
  146.         <name>New Button</name>
  147.         <script>on mouseUp
  148. if the optionKey is down then
  149. pass mouseUp
  150. end if
  151.  
  152. if the commandKey is down then go home
  153. else pass mouseUp
  154. end mouseUp
  155. </script>
  156.     </part>
  157.     <content>
  158.         <layer>card</layer>
  159.         <id>14</id>
  160.         <text>Welcome to the AutoHelp Demonstration stack.  Autohelp is a script that resides in the card or stack, intercepts aimless mouse clicks, and gives the user the option of getting help if too many aimless clicks are made.  Believe it or not, it actually has helped a few first time Mac/HyperCard users.  (OK, so I lied.)
  161.  
  162. So How's it Done?
  163. Option-click somewhere on the card to get a look at the script that makes it all possible.
  164.  
  165. About the About:
  166. This is the "About AutoHelp Demo" field.  If you don't believe me, then check it out yourself (I dare ya).  Click on it to get rid of it.
  167.  
  168. Ruby Slippers:
  169. Command-click on the house when you've had enough and want to go home.
  170.  
  171. Obligatory Disclaimer:  
  172. This demonstration script works, but I can't be held responsible for what horrors you perpetrate on your own stacks - especially since this script is in the public domain.
  173.  
  174. About the Picture:
  175. Just in case you were wondering, the picture on this card has nothing to do with what the stack demonstrates.  The picture does, however, have a lot to do with the currently moribund US space program.
  176.  
  177. Sad, but true.  Time for Americans to learn Japanese or Russian, it seems.  At least with the Script Manager we'll still be able to use HyperCard.
  178.  
  179. Richard Johnson
  180.  
  181. </text>
  182.     </content>
  183.     <content>
  184.         <layer>card</layer>
  185.         <id>15</id>
  186.         <text>AutoHelp Demonstration by Richard Johnson
  187. </text>
  188.     </content>
  189.     <content>
  190.         <layer>card</layer>
  191.         <id>16</id>
  192.         <text>Click quickly 3 or so times anywhere on the card
  193. </text>
  194.     </content>
  195.     <name>Title</name>
  196.     <script>--
  197. -- AutoHelp Script
  198. --
  199. -- by Richard Johnson
  200. --
  201. -- GEnie: RJ.JOHNSON
  202. -- Snail Mail: 4035 Darley
  203. --             Boulder, CO 80303
  204. --
  205. --  This script will kick the user into help (or wherever else the user
  206. --  needs to be kicked) if he or she aimlessly clicks the mouse too
  207. --  many times in short order.  (It will also, just for a meaningless
  208. --  demonstration, do the same if the user taps that totally useless
  209. --  "enter" key.)
  210. --
  211. --  This script was written after watching one utterly confused lady
  212. --  try out HyperCard on a dealer's demonstration Mac one day.  She was
  213. --  very upset when she repeatedly pushed that big button on the uh,
  214. --  mouse, yeah, that's right - but nothing happened.  The fact that
  215. --  the stack had no readily visible buttons only contributed to her
  216. --  confusion.  I figured there had to be a way to help those sorts of
  217. --  disadvantaged people find the one true path, hence the birth of
  218. --  this modest little script.
  219. --
  220. --  (Thanks be to Bill Atkinson for HyperCard, and to Bo3b Johnson for
  221. --  getting me interested in the Mac in the first place.)
  222.  
  223. on openCard
  224. global maxNumClicks
  225. global delay
  226.  
  227. --  The number of aimless clicks before the help is triggered
  228. --  is in "maxNumClicks".
  229. --  "Delay" is the number of seconds after the last aimless click at
  230. --  which the click counter is cleared.
  231.  
  232. --  Set up those globals where we can get at 'em easy.
  233. put 3 into maxNumClicks  --  a pure, unadulterated number
  234. put 3 into delay  --  seconds - a number with meaning
  235. --  Hide the help until the user has acted "confused".
  236. hide card field "About AutoHelp Demo"
  237. set the lockText of card field "About AutoHelp Demo" to true
  238. end openCard
  239.  
  240.  
  241. on mouseUp
  242. global timeOut
  243. global aimlessClicks
  244. global maxNumClicks
  245. global delay
  246.  
  247. --  The count of aimless clicks since the last time out is in
  248. --  "aimlessClicks".
  249. --  The time at which the count is to be zeroed is stored in
  250. --  "timeOut".
  251.  
  252. --  Maybe the click is not aimless.  After all, if the user _has_
  253. --  found the option key.
  254. if the optionKey is down then
  255. edit script of target
  256. exit mouseUp
  257. end if
  258.  
  259. --  Check to see if the help has already been activated, and bail
  260. --  out if so
  261. if the visible of card field "About Autohelp Demo" is true ¬¨
  262. then exit mouseup
  263.  
  264. --  Set the time at which aimlessClicks will be reset if this just
  265. --  happens to be the user's last aimless click.
  266. put the seconds + delay into timeOut
  267. add 1 to aimlessClicks
  268. --  Check aimlessClicks against the trigger level and declare the
  269. --  user confused if necessary.
  270. if aimlessClicks >= maxNumClicks then
  271. put 0 into aimlessClicks
  272. confusedUser
  273. end if
  274. end mouseUp
  275.  
  276.  
  277. on idle
  278. global timeOut
  279. global aimlessClicks
  280. --  Reset aimlessClicks if the user hasn't clicked in a short while.
  281. if the seconds > timeOut then put 0 into aimlessClicks
  282. pass idle  --  Or don't if you don't want to
  283. end idle
  284.  
  285.  
  286. on enterKey
  287. --  Yes, you can do it by pressing a key too.
  288. if the visible of card field "About AutoHelp Demo" is false ¬¨
  289. then confusedUser
  290. end enterKey
  291.  
  292.  
  293. on confusedUser
  294.  
  295. --  The user is lost (by definition!), so give him or her a chance
  296. --  for help.
  297.  
  298. --  No offense intended here, but if you want to take offense
  299. --  anyway you're certainly welcome to as much as you can carry.
  300. answer "Do you need help?" with "Oh God Yes" or "Uh uh"
  301. if it is "Oh God Yes" then
  302. --  Set up your own dirty work here...
  303. show card field "About AutoHelp Demo"
  304. end if
  305. end confusedUser
  306.  
  307.  
  308. on CloseStack
  309.  
  310. --  An added bonus!  Since so many stacks were uploaded to BBSes and
  311. --  so on without being compacted first, my friends (yes, I have a
  312. --  few of those) and I decided this neat little reminder would be
  313. --  used, without complaint, by the chronically forgetful among us.
  314.  
  315. put the short name of this stack into stackName
  316. answer "Compact" && stackName && "first?" ¬¨
  317. with "Please Do" or "No Thanks"
  318. if it is "Please Do" then domenu compact stack
  319. pass CloseStack
  320. end CloseStack
  321. </script>
  322. </card>
  323.  
  324.  
  325.